package com.lngsyz.ywtb.enumeration;

import org.apache.commons.lang.StringUtils;

/**   
 *
 * @version: 1.0
 */

public enum PayChannel {
	WX("微信", "wxpay"),
	ZFB("支付宝", "alipay")
	;

	private String name;
	private String key;

	private PayChannel(String name, String key) {
		this.name = name;
		this.key = key;
	}

	public static String getNameByKey(String key) {
		if(StringUtils.isNotBlank(key)) {
			for (PayChannel state : PayChannel.values()) {
				if (state.getKey().equalsIgnoreCase(key)) {
					return state.getName();
				}
			}
		}
		return "其他";
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getKey() {
		return key;
	}

	public void setKey(String key) {
		this.key = key;
	}
}
